<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\Win32\\Graphics\\Win32\\Resource.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LINE 2 &quot;libraries\\Win32\\Graphics\\Win32\\Resource.hsc&quot; #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LINE 6 &quot;libraries\\Win32\\Graphics\\Win32\\Resource.hsc&quot; #-}</span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  Graphics.Win32.Resource</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) Alastair Reid, 1997-2003</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  Esa Ilari Vuokko &lt;ei@vuokko.info&gt;</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- A collection of FFI declarations for interfacing with Win32.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Graphics.Win32.Resource</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Win32.Types</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign</span><span class="hs-cpp">

#include &quot;windows_cconv.h&quot;
</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-identifier">beginUpdateResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Bool</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HANDLE</span><span>
</span><span id="line-31"></span><span class="hs-identifier">beginUpdateResource</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-identifier">del</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-32"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-33"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;BeginUpdateResource&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_BeginUpdateResource</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-identifier">del</span><span>
</span><span id="line-34"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h BeginUpdateResourceW&quot;</span><span>
</span><span id="line-35"></span><span>  </span><span class="hs-identifier">c_BeginUpdateResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Bool</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HANDLE</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">ResourceImageType</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">type</span><span>   </span><span class="hs-identifier">HRSRC</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-keyword">type</span><span>   </span><span class="hs-identifier">HGLOBAL</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-identifier">iMAGE_BITMAP</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceImageType</span><span>
</span><span id="line-44"></span><span class="hs-identifier">iMAGE_BITMAP</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">0</span><span>
</span><span id="line-45"></span><span class="hs-identifier">iMAGE_ICON</span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceImageType</span><span>
</span><span id="line-46"></span><span class="hs-identifier">iMAGE_ICON</span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1</span><span>
</span><span id="line-47"></span><span class="hs-identifier">iMAGE_CURSOR</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceImageType</span><span>
</span><span id="line-48"></span><span class="hs-identifier">iMAGE_CURSOR</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">2</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-pragma">{-# LINE 48 &quot;libraries\\Win32\\Graphics\\Win32\\Resource.hsc&quot; #-}</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-identifier">copyImage</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceImageType</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">UINT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HANDLE</span><span>
</span><span id="line-50"></span><span class="hs-identifier">copyImage</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-51"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;CopyImage&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_CopyImage</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">flags</span><span>
</span><span id="line-52"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h CopyImage&quot;</span><span>
</span><span id="line-53"></span><span>  </span><span class="hs-identifier">c_CopyImage</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceImageType</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">UINT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HANDLE</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-identifier">endUpdateResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-identifier">endUpdateResource</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">discard</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-57"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;EndUpdateResource&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_EndUpdateResource</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">discard</span><span>
</span><span id="line-58"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h EndUpdateResourceW&quot;</span><span>
</span><span id="line-59"></span><span>  </span><span class="hs-identifier">c_EndUpdateResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">ResourceType</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">LPCTSTR</span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-identifier">rT_ACCELERATOR</span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-64"></span><span class="hs-identifier">rT_ACCELERATOR</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">9</span><span>
</span><span id="line-65"></span><span class="hs-identifier">rT_ANICURSOR</span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-66"></span><span class="hs-identifier">rT_ANICURSOR</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">21</span><span>
</span><span id="line-67"></span><span class="hs-identifier">rT_ANIICON</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-68"></span><span class="hs-identifier">rT_ANIICON</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">22</span><span>
</span><span id="line-69"></span><span class="hs-identifier">rT_BITMAP</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-70"></span><span class="hs-identifier">rT_BITMAP</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">2</span><span>
</span><span id="line-71"></span><span class="hs-identifier">rT_CURSOR</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-72"></span><span class="hs-identifier">rT_CURSOR</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">1</span><span>
</span><span id="line-73"></span><span class="hs-identifier">rT_DIALOG</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-74"></span><span class="hs-identifier">rT_DIALOG</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">5</span><span>
</span><span id="line-75"></span><span class="hs-identifier">rT_FONT</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-76"></span><span class="hs-identifier">rT_FONT</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">8</span><span>
</span><span id="line-77"></span><span class="hs-identifier">rT_FONTDIR</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-78"></span><span class="hs-identifier">rT_FONTDIR</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">7</span><span>
</span><span id="line-79"></span><span class="hs-identifier">rT_GROUP_CURSOR</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-80"></span><span class="hs-identifier">rT_GROUP_CURSOR</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">12</span><span>
</span><span id="line-81"></span><span class="hs-identifier">rT_GROUP_ICON</span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-82"></span><span class="hs-identifier">rT_GROUP_ICON</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">14</span><span>
</span><span id="line-83"></span><span class="hs-identifier">rT_HTML</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-84"></span><span class="hs-identifier">rT_HTML</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">23</span><span>
</span><span id="line-85"></span><span class="hs-identifier">rT_ICON</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-86"></span><span class="hs-identifier">rT_ICON</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">3</span><span>
</span><span id="line-87"></span><span class="hs-identifier">rT_MENU</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-88"></span><span class="hs-identifier">rT_MENU</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">4</span><span>
</span><span id="line-89"></span><span class="hs-identifier">rT_MESSAGETABLE</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-90"></span><span class="hs-identifier">rT_MESSAGETABLE</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">11</span><span>
</span><span id="line-91"></span><span class="hs-identifier">rT_RCDATA</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-92"></span><span class="hs-identifier">rT_RCDATA</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">10</span><span>
</span><span id="line-93"></span><span class="hs-identifier">rT_STRING</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-94"></span><span class="hs-identifier">rT_STRING</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">6</span><span>
</span><span id="line-95"></span><span class="hs-identifier">rT_VERSION</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceType</span><span>
</span><span id="line-96"></span><span class="hs-identifier">rT_VERSION</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-number">16</span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="hs-pragma">{-# LINE 82 &quot;libraries\\Win32\\Graphics\\Win32\\Resource.hsc&quot; #-}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-identifier">findResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceType</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HRSRC</span><span>
</span><span id="line-84"></span><span class="hs-identifier">findResource</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-86"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;FindResource&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_FindResource</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-identifier">ty</span><span>
</span><span id="line-87"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h FindResourceW&quot;</span><span>
</span><span id="line-88"></span><span>  </span><span class="hs-identifier">c_FindResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HRSRC</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-comment">-- was: LPCTSTR_</span><span>
</span><span id="line-91"></span><span class="hs-identifier">findResourceEx</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceType</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HRSRC</span><span>
</span><span id="line-92"></span><span class="hs-identifier">findResourceEx</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">lang</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-93"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-94"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;FindResourceEx&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_FindResourceEx</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">lang</span><span>
</span><span id="line-95"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h FindResourceExW&quot;</span><span>
</span><span id="line-96"></span><span>  </span><span class="hs-identifier">c_FindResourceEx</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HRSRC</span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">ResourceSize</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span class="hs-identifier">lR_DEFAULTSIZE</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceSize</span><span>
</span><span id="line-101"></span><span class="hs-identifier">lR_DEFAULTSIZE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">64</span><span>
</span><span id="line-102"></span><span class="hs-pragma">{-# LINE 102 &quot;libraries\\Win32\\Graphics\\Win32\\Resource.hsc&quot; #-}</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="hs-identifier">lR_DEFAULTCOLOR</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span>
</span><span id="line-106"></span><span class="hs-identifier">lR_DEFAULTCOLOR</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">0</span><span>
</span><span id="line-107"></span><span class="hs-identifier">lR_CREATEDIBSECTION</span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span>
</span><span id="line-108"></span><span class="hs-identifier">lR_CREATEDIBSECTION</span><span>   </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">8192</span><span>
</span><span id="line-109"></span><span class="hs-identifier">lR_LOADFROMFILE</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span>
</span><span id="line-110"></span><span class="hs-identifier">lR_LOADFROMFILE</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">16</span><span>
</span><span id="line-111"></span><span class="hs-identifier">lR_LOADMAP3DCOLORS</span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span>
</span><span id="line-112"></span><span class="hs-identifier">lR_LOADMAP3DCOLORS</span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">4096</span><span>
</span><span id="line-113"></span><span class="hs-identifier">lR_LOADTRANSPARENT</span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span>
</span><span id="line-114"></span><span class="hs-identifier">lR_LOADTRANSPARENT</span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">32</span><span>
</span><span id="line-115"></span><span class="hs-identifier">lR_MONOCHROME</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span>
</span><span id="line-116"></span><span class="hs-identifier">lR_MONOCHROME</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1</span><span>
</span><span id="line-117"></span><span class="hs-identifier">lR_SHARED</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span>
</span><span id="line-118"></span><span class="hs-identifier">lR_SHARED</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">32768</span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="hs-pragma">{-# LINE 114 &quot;libraries\\Win32\\Graphics\\Win32\\Resource.hsc&quot; #-}</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-comment">-- , LR_VGACOLOR (Not in mingw-20001111 headers)</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="hs-comment">-- was: LPCTSTR_</span><span>
</span><span id="line-118"></span><span class="hs-identifier">loadImage</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceImageType</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceSize</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceSize</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HANDLE</span><span>
</span><span id="line-119"></span><span class="hs-identifier">loadImage</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">load</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-121"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;LoadImage&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_LoadImage</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">load</span><span>
</span><span id="line-122"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h LoadImageW&quot;</span><span>
</span><span id="line-123"></span><span>  </span><span class="hs-identifier">c_LoadImage</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceImageType</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceSize</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceSize</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LoadImageFlags</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HANDLE</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-identifier">loadResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HRSRC</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HGLOBAL</span><span>
</span><span id="line-126"></span><span class="hs-identifier">loadResource</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-127"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;LoadResource&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_LoadResource</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-128"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h LoadResource&quot;</span><span>
</span><span id="line-129"></span><span>  </span><span class="hs-identifier">c_LoadResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HRSRC</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HGLOBAL</span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="hs-identifier">lockResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HGLOBAL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Addr</span><span>
</span><span id="line-132"></span><span class="hs-identifier">lockResource</span><span> </span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-133"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;LockResource&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_LockResource</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-134"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h LockResource&quot;</span><span>
</span><span id="line-135"></span><span>  </span><span class="hs-identifier">c_LockResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HGLOBAL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Addr</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="hs-identifier">sizeofResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HRSRC</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-138"></span><span class="hs-identifier">sizeofResource</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-identifier">failIfZero</span><span> </span><span class="hs-string">&quot;SizeofResource&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_SizeofResource</span><span> </span><span class="hs-identifier">hmod</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-140"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h SizeofResource&quot;</span><span>
</span><span id="line-141"></span><span>  </span><span class="hs-identifier">c_SizeofResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HMODULE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HRSRC</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">-- was: LPCTSTR_</span><span>
</span><span id="line-144"></span><span class="hs-identifier">updateResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">ResourceType</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Addr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span class="hs-identifier">updateResource</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-identifier">lang</span><span> </span><span class="hs-identifier">p_data</span><span> </span><span class="hs-identifier">data_len</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-146"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-147"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;UpdateResource&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-148"></span><span>    </span><span class="hs-identifier">c_UpdateResource</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">ty</span><span> </span><span class="hs-identifier">c_name</span><span> </span><span class="hs-identifier">lang</span><span> </span><span class="hs-identifier">p_data</span><span> </span><span class="hs-identifier">data_len</span><span>
</span><span id="line-149"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h UpdateResourceW&quot;</span><span>
</span><span id="line-150"></span><span>  </span><span class="hs-identifier">c_UpdateResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Addr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-151"></span></pre></body></html>